const mongoose = require('mongoose');

const DB_URL = "mongodb://localhost:27017/sh2003";

mongoose.connect(DB_URL,{ useNewUrlParser: true,useUnifiedTopology: true});

mongoose.connection.on('connected', () => {
    console.log('connected success');
});

mongoose.connection.on('disconnected',() => {
    console.log('disconnected success');
})

mongoose.connection.on('error', (err) => {
    if(err) throw err;
    console.log('error occur')
});

module.exports = mongoose;